window.addEvent('domready', function(){

   $('partnerships').addEvent('click', function(e) {
   var request = new Request({
	url: 'views/ParthershipsContenido.php',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('contenido').set('html',response);
		//$$('.menuS').each(function(element) { element.setStyle('display','none');});
	     $$('.MI').each(function(element) { element.set('id','#');});
	       var miElemento = $('partnerships').getFirst();
	 	   miElemento.set('id','current');
  	
	}
})
 request.send();
  })
  
   $('events').addEvent('click', function(e) {
 $$('.MS').each(function(element) { element.set('id','#');});
$$('.MI').each(function(element) { element.set('id','#');});
   	new Event(e).stop();
   	//alert("hola");
   var request = new Request({
	url: 'views/EventosTabsContenido.php',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('contenido').set('html',response);
		   $$('.MI').each(function(element) { element.set('id','#');});
		    	new Asset.javascript('scriptaplicacion/tabsEventos2.js', {id: 'unId3'});
  
	       var miElemento = $('events').getFirst();
	 	         miElemento.set('id','current');
	 	         
			
		 	
	}
})
 request.send();
  })
  

   $('projects').addEvent('click', function(e) {
 $$('.MS').each(function(element) { element.set('id','#');});
$$('.MI').each(function(element) { element.set('id','#');});
    //alert("Hola");
   var request = new Request({
	url: 'views/ProyectosTabsContenido.php',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		//alert("Hola Adentro 1");
		$('contenido').set('html',response);
		 //alert("Hola Adentro 2");
		 if($('unIdP1') == null){
			 new Asset.javascript('scriptaplicacion/tabsProyectos.js', {id: 'unIdP1'});
		}

	    var miElemento = $('projects').getFirst();
		miElemento.set('id','current');

	    miElemento = $('MSprojects').getParent();
	    miElemento.set('id','current');
		 	
	}
  })
  //alert("despues");
 request.send();
  })


   $('staff').addEvent('click', function(e) {
 $$('.MS').each(function(element) { element.set('id','#');});
$$('.MI').each(function(element) { element.set('id','#');});
    var request = new Request({
	url: 'views/StaffContenido.php',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('contenido').set('html',response);
		 //$$('.menuS').each(function(element) { element.setStyle('display','none');});
		  // new Event(e).stop();
		   	  // new Asset.javascript('scriptaplicacion/tooltipv3.js', {id: 'js1'});
		   	  //if($('idsc1')==null){
		   	   	new Asset.javascript('scriptaplicacion/staffcontenido.js', {id: 'idsc1'});
		   	  //}

	    		var miElemento = $('staff').getFirst();
				miElemento.set('id','current');
			
	             miElemento = $('MSstaff').getParent();
	             miElemento.set('id','current');
	}
})

 request.send();
  
  
  })

   $('lineas').addEvent('click', function(e) {
 $$('.MS').each(function(element) { element.set('id','#');});
$$('.MI').each(function(element) { element.set('id','#');});
    var request = new Request({
	url: 'views/LineaInvestigacionContenido.php',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		
		$('contenido').set('html',response);
		new Asset.javascript('scriptaplicacion/acordionlinv.js', {id: 'idsc1'});

	    var miElemento = $('lineas').getFirst();
		miElemento.set('id','current');
		
	}
})

 request.send();
  
  
  })


  $('home').addEvent('click', function(e) {
 $$('.MS').each(function(element) { element.set('id','#');});
$$('.MI').each(function(element) { element.set('id','#');});
    var request = new Request({
	url: 'views/HomeContenido.php',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('contenido').set('html',response);
	
	    var miElemento = $('home').getFirst();
		miElemento.set('id','current');
	
	    miElemento = $('MShome').getParent();
	    miElemento.set('id','current');
	}
})
	 request.send();
  })


  $('teaching').addEvent('click', function(e) {
 $$('.MS').each(function(element) { element.set('id','#');});
$$('.MI').each(function(element) { element.set('id','#');});
    var request = new Request({
	url: 'views/TeachingTabsContenido.php',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('contenido').set('html',response);
	  
	    var miElemento = $('teaching').getFirst();
		miElemento.set('id','current');
		new Asset.javascript('scriptaplicacion/tabsTeaching.js', {id: 'idtp1'});
	}
})
	 request.send();
  })


$('ToolsService').addEvent('click', function(e) {
   $$('.MS').each(function(element) { element.set('id','#');});
$$('.MI').each(function(element) { element.set('id','#');});
    var request = new Request({
	url: 'views/ToolsServiceTabsContenido.php',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('contenido').set('html',response);
	
	    var miElemento = $('ToolsService').getFirst();
	    miElemento.set('id','current');
	    miElemento = $('MSToolsService').getParent();
	    miElemento.set('id','current');
  	
			new Asset.javascript('scriptaplicacion/tabsToolsService.js', {id: 'idtp1'});
	}
})
	 request.send();
  })


  $('publications').addEvent('click', function(e) {
   $$('.MS').each(function(element) { element.set('id','#');});
$$('.MI').each(function(element) { element.set('id','#');});
    var request = new Request({
	url: 'views/PublicacionesTabsContenido.php',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		//alert("hola!");
		$('contenido').set('html',response);
	    //$$('.menuS').each(function(element) { element.setStyle('display','none');});
		//new Event(e).stop();
		if($('idtp1')==null){
		
		new Asset.javascript('scriptaplicacion/tabsPublicaciones.js', {id: 'idtp1'});
		}
		
	       var miElemento = $('publications').getFirst();
	 	   miElemento.set('id','current');
	 	
	    miElemento = $('MSpublications').getParent();
	    miElemento.set('id','current');
  	
			
 	
	}
})
	 request.send();
  })
	



 /*var request = new Request({
	url: 'views/HomeContenido.php',
	method: 'get',
	update: 'refresh-me',
	onComplete: function(response) {
		$('contenido').set('html',response);
	    //$$('.menuS').each(function(element) { element.setStyle('display','none');});
	    $$('.MI').each(function(element) { element.set('id','#');});
	       var miElemento = $('home').getFirst();
	 	   miElemento.set('id','current');

	}
})
	 request.send();
*/
  
});	


